-- GENERATED SPELL FOR [Dalaran Theurgist] --


function spell0_2272(pUnit, Event) --@Frost Ward,Self--
pUnit:FullCastSpellOnTarget(15044,pUnit)
pUnit:RegisterEvent('Sorts_2272', 0, 1)
end

function spell1_2272(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(20819,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2272', 7000, 1)
end

function spell2_2272(pUnit, Event) --@Summon Spirit of Old,Self--
pUnit:FullCastSpellOnTarget(3652,pUnit)
pUnit:RegisterEvent('Sorts_2272', 14000, 1)
end

function Sorts_2272(pUnit, Event)
local choix_sorts_2272 = math.random(0, 2)
if choix_sorts_2272 == 0 then
pUnit:RegisterEvent('spell0_2272', 1, 1)
end
if choix_sorts_2272 == 1 then
pUnit:RegisterEvent('spell1_2272', 1, 1)
end
if choix_sorts_2272 == 2 then
pUnit:RegisterEvent('spell2_2272', 1, 1)
end
end

function mob2272_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2272', math.random(1500, 3000), 1)
end

function mob2272_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2272_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2272_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2272, 1, 'mob2272_Action')
RegisterUnitEvent(2272, 2, 'mob2272_Leave')
RegisterUnitEvent(2272, 3, 'mob2272_Kill')
RegisterUnitEvent(2272, 4, 'mob2272_Die')
